﻿<Window x:Class="sync.UI.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="455" Width="724" x:Name="MainWindow">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="25" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal">
                <Button x:Name="OpenRepository" Content="Open" Click="OpenRepository_Click" />
                <Button x:Name="CreateRepository" Content="Create" Click="CreateRepository_Click" />
            </StackPanel>
            <ListView Grid.Row="1" x:Name="RepositoryList" ItemsSource="{Binding ElementName=MainWindow, Path=LoadedRepositories}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding RepositoryInfo.Id}" />
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

        </Grid>
        <TabControl Grid.Column="1">
            <TabItem Header="Local Files">
                <ListView x:Name="SelectedRepositoryFileList" ItemsSource="{Binding ElementName=RepositoryList, Path=SelectedItem.LocalFiles}">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </TabItem>
            <TabItem Header="Nodes">
                <ListView x:Name="SelectedRepositoryNodeList" ItemsSource="{Binding ElementName=RepositoryList, Path=SelectedItem.ConnectionProvider.KnowenNodes}">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Id}" />
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </TabItem>
        </TabControl>

    </Grid>
</Window>
